$.fn.extend {

    save:(
        url
        data
        success
        error
    )->
        @err {}
        $.postJSON(
            url
            data
        ).then(
            success
            (err)=>
                tip = err.responseJSON
                if tip
                    tip = error?(tip) or tip
                    @err tip
                else
                    tip = err.responseText
                    $.box.alert """<div style="color:#f00;font-size:21px;text-align:center;">#{tip}</div>"""
        )

}
